package de.gameduell.framework.gui.popup {
	import flash.display.Sprite;
	import flash.events.Event;
	
	import de.gameduell.framework.application.Window;	

	/**
	 * @author cbra
	 */
	public class PopupManager {
	
		private static var instance:PopupManager;
		

		private var window:Window;
		private var popups:Array;
		

		public static function getInstance():PopupManager{
			if(instance == null){
				instance = new PopupManager();
			}
			return instance;
		}
		
		public function init(aWindow:Window):void{
			window = aWindow;
			popups = new Array();
		}
		
		public function get popupPlane():Sprite{
			return window.getPopupPlane();
		}
		
		public function register(popup:Popup):void {
			popups.push(popup);
			popup.addEventListener(PopupEvent.SHOW, onShowPopup);
			popup.addEventListener(PopupEvent.HIDE, onHidePopup);
		}
		
		private function onShowPopup(event:Event):void {
			
		}

		private function onHidePopup(event:Event):void {
		}
	}
}
